ALREADY INSTALLED OR EASY TO GET: PYTHON SCRIPTS FOR A MAC (AND FOR WINDOWS, WHERE PYTHON IS ALLOWED)

These seven scripts do the same jobs as the PowerShell scripts in the book.
Use them on a Mac, or on a Windows PC where your company allows Python.
The Microsoft Project macros have no Mac version, because Microsoft Project
doesn't run on a Mac. Use ProjectLibre with scripts 6 and 7 instead.

BEFORE YOU RUN ANYTHING
- Check your client's policies on scripts and on which AI tools you may use.
- Test each script on a copy of a small folder first.
- The scripts read and copy. They never delete or change your original files.

ONE-TIME SETUP ON A MAC
1. Open Terminal (Applications > Utilities > Terminal).
2. Type:  python3 --version   and press Return.
   If your Mac offers to install the "command line developer tools", click Install
   and wait for it to finish. Then type the command again.
3. Create and activate a dedicated environment, then install the three add-ons for scripts 4 and 7:
      python3 -m venv ~/.already-installed-venv
      source ~/.already-installed-venv/bin/activate
      python -m pip install python-docx python-pptx openpyxl
4. Script 3 (PDF copies) needs the free LibreOffice. Download it from libreoffice.org.

HOW TO RUN A SCRIPT
Activate the environment in new Terminal sessions first:
   source ~/.already-installed-venv/bin/activate
Type  python3  and a space, drag the script from Finder into the Terminal window,
then add the folders it needs and press Return. For example:
   python3 1-Inventory-ProjectDocs.py ~/Documents/ProjectDocs
   python3 2-Sort-ProjectDocs.py ~/Documents/ProjectDocs ~/Documents/ProjectDocs_Sorted --preview
   python3 3-Convert-OfficeToPdf.py ~/Documents/ProjectDocs_Sorted ~/Documents/ProjectDocs_PDF
   python3 4-Export-OfficeText.py ~/Documents/ProjectDocs_Sorted ~/Documents/ProjectDocs_Text
   python3 5-New-UploadBundles.py ~/Documents/ProjectDocs_Text ~/Documents/ProjectDocs_Bundles --max-kb 120
   python3 6-ProjectLibre-Reports.py ~/Projects/MyPlan.xml
   python3 7-ProjectLibre-StatusDeck.py ~/Projects/MyPlan.xml
Tip: you can also drag a folder from Finder into Terminal instead of typing its path.
Add  --help  after any script name to see its options.

ON WINDOWS
If approved by IT, use py -m venv .venv and activate with .venv\Scripts\Activate.ps1, if policy permits. Install the packages with python -m pip install python-docx python-pptx openpyxl. Use python in place of python3.

NOTES
- Script 4 reads .docx, .xlsx and .pptx files. Open older .doc, .xls and .ppt files
  and save them in the newer format first, or turn them into PDFs with script 3.
- Script 7 needs script 6 in the same folder.
- Scripts 6 and 7 use the same rules as the book: Red at 10 or more working days late
  against baseline, Amber at 5 or more. Risks and issues are tasks whose names start
  with "Risk:" or "Issue:".

Provided as is, without warranty. Microsoft, Windows, Word, Excel, PowerPoint and
Microsoft Project are trademarks of Microsoft Corporation. Mac is a trademark of Apple Inc.
LibreOffice is a trademark of The Document Foundation. Python is a trademark of the
Python Software Foundation.
